import dayjs from 'dayjs'

export const daysBetween = (start: string, end: string) => {
  return dayjs(end).startOf('day').diff(dayjs(start).startOf('day'), 'day')
}

export const formatDate = (date: string | Date, pattern: string = 'YYYY-MM-DD HH:mm:ss') => {
  return dayjs(date).format(pattern)
}
